<?php
/**
 *  💡 免责声明：本软件不得用于商业用途，仅做学习交流
 *  ⚠️ 权利声明：本软件由版权人提供产品技术支持
 *  📅 项目编号：NX2025-0135
 */
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePointProductsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('point_products', function (Blueprint $table) {
            $table->id();
            $table->string('name')->comment('商品名称');
            $table->string('subtitle')->comment('商品副标题');
            $table->string('main_image')->nullable()->comment('主图');
            $table->text('carousel_image')->nullable()->comment('轮播图');
            $table->decimal('point_price', 10, 2)->comment('积分');
            $table->decimal('bean_price', 10, 2)->comment('KC通证');
            $table->integer('stock')->default(0)->comment('库存');
            $table->integer('sold_num')->default(0)->comment('销量');
            $table->text('description')->nullable()->comment('商品描述');
            $table->json('sku')->nullable()->comment('规格');
            $table->longText('detail')->nullable()->comment('商品详情');
            $table->tinyInteger('status')->default(1)->comment('状态(0:下架 1:上架)');
            $table->integer('sort')->default(0)->comment('排序');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('point_products');
    }
}
